package com.hundred.item.dao;

import java.sql.SQLException;
import java.util.List;

import com.hundred.item.dao.dataobject.ItemDO;
import com.hundred.item.dao.dataobject.ItemReqDO;

/**
 * ITEM-DAO
 * @author YUTONG
 *
 */
public interface ItemDao {
	
	/**
	 * 
	 * @param itemDo
	 * @throws SQLException
	 */
	public long insertItem(ItemDO itemDo) throws SQLException;

	/**
	 * 
	 * @param itemDo
	 * @return
	 * @throws SQLException
	 */
	public int updateItem(ItemDO itemDo) throws SQLException;

	/**
	 * 
	 * @param itemId
	 * @return
	 * @throws SQLException
	 */
	public int deleteItem(long itemId) throws SQLException;

	/**
	 * 
	 * @param itemId
	 * @return
	 */
	public ItemDO getItemById(ItemReqDO itemReq);
	
	/**
	 * 
	 * @param itemId
	 * @return
	 */
	public ItemDO getHistoryItemById(long itemId);
	
	/**
	 * 
	 * @param status
	 * @param startRow
	 * @param endRow
	 * @return
	 */
	public List<ItemDO> getTopItemsList(int status,long startRow,long endRow);
	
	/**
	 * 
	 * @param status
	 * @return
	 */
	public long countTotalOnlineItems(int status);
	
	public List<ItemDO> getInitCacheItems(int status);
}
